package cn.laixueit.service.impl;

import cn.laixueit.mapper.CategoryMapper;
import cn.laixueit.pojo.item.Category;
import cn.laixueit.service.CategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Override
    public List<String> findNamesByIds(List<Long> ids) {
        ArrayList<String> names = new ArrayList<>();
        for (Long id : ids) {
            names.add(getById(id).getName());
        }
        return names;
    }
}
